package CS;

import java.util.Scanner;

public class Demo4 {
    public static void main(String[] args) {

        for (int i = 1000; i < 10000; i++) {
            int d=i/1000;
            int c=i/100%10;
            int b=i/10%10;
            int a=i%10;
            if ((c+d)*(a+b)>1000 &&(c+d)*(a+b)<10000 ) {
                System.out.println(i);
            }
        }
    }
}
